function gradeTest() {

     var totalQuestions = 10;
     var correctAnswers = 0;
     var alertText;
     var i;
	 var selectedAnswers = new Array()
	 var correctAnswersArray = new Array()
	 var incorrectAnswersArray = new Array()

//radio 
	 var a1 = document.getElementsByName('q1');
     for(i = 0; i < a1.length; i++) {
          if(a1[i].checked) {
			  selectedAnswers.push(a1[i].value)
               if(a1[i].value == 'False') {
               correctAnswersArray.push("Question 1: " + a1[i].value)
					correctAnswers++;
               }
	       }
     }
//radio
	 var a2 = document.getElementsByName('q2');
     for(i = 0; i < a2.length; i++) {
          if(a2[i].checked) {
			  selectedAnswers.push(a2[i].value)
               if(a2[i].value == 'd') {
				correctAnswersArray.push("Question 2: " + a2[i].value)
                    correctAnswers++;
                    break;
               }
          }
     }
	 	 var a3 = document.getElementsByName('q3');
     for(i = 0; i < a3.length; i++) {
          if(a3[i].checked) {
			  selectedAnswers.push(a3[i].value)
               if(a3[i].value == '5c') {
               correctAnswersArray.push("Question 3: " + a3[i].value)
                    correctAnswers++;
                    break;
               }
          }
     }
/*//checkbox	 
	 var a3 = document.getElementsByName('q3');
     var a3answers = new Array();
     var a3right = new Array('4b','6d');
     var a3bool = true;
     for(i = 0; i < a3.length; i++) {
          if(a3[i].checked) {
              a3answers.push(a3[i].value);
          }
     }
    a3answers.sort();
	var a3answersStr = a3answers.toString();
	var a3answersSplit = a3answersStr.split(",");
	var a3answersTidy = a3answersSplit.join(" and ") 
	selectedAnswers.push(a3answersTidy)
	a3right.sort();
     if(a3answers.length == a3right.length) {
          for(i = 0; i < a3answers.length; i++) {
               if(a3answers[i] != a3right[i]) {
                    a3bool = false;
                    break;
               }
          }
     }
     else {
          a3bool = false;
     }
     if(a3bool == true) {
          correctAnswers++;
     }*/
//radio
	 var a4 = document.getElementsByName('q4');
     for(i = 0; i < a4.length; i++) {
          if(a4[i].checked) {
              selectedAnswers.push(a4[i].value)
			   if(a4[i].value == '8') {
               correctAnswersArray.push("Question 4: " + a4[i].value)
                    correctAnswers++;
                    break;
               }
          }
     } 
//radio	 
	 var a5 = document.getElementsByName('q5');
     for(i = 0; i < a5.length; i++) {
          if(a5[i].checked) {
			  selectedAnswers.push(a5[i].value)
               if(a5[i].value == '10') {
               correctAnswersArray.push("Question 5: " + a5[i].value)
                    correctAnswers++;
                    break;
               }
          }
     }
/*//checkbox
	 var a6 = document.getElementsByName('q6');
     var a6answers = new Array();
     var a6right = new Array('12','18','24');
     var a6bool = true;
 
     for(i = 0; i < a6.length; i++) {
          if(a6[i].checked) {
               a6answers.push(a6[i].value);
          }
     }
	a6answers.sort();
	var a6answersStr = a6answers.toString();
	var a6answersSplit = a6answersStr.split(",");
	var a6answersTidy = a6answersSplit.join(" and ") 
	selectedAnswers.push(a6answersTidy)
	a6right.sort();
     if(a6answers.length == a6right.length) {
          for(i = 0; i < a6answers.length; i++) {
               if(a6answers[i] != a6right[i]) {
                    a6bool = false;
                    break;
               }
          }
     }
     else {
          a6bool = false;
     }
     if(a6bool == true) {
          correctAnswers++;
     }*/
//radio	 
	 var a6 = document.getElementsByName('q6');
     for(i = 0; i < a6.length; i++) {
          if(a6[i].checked) {
			  selectedAnswers.push(a6[i].value)
               if(a6[i].value == '12') {
                correctAnswersArray.push("Question 6: " + a6[i].value)
                   correctAnswers++;
                    break;
               }
          }
     }
	 //radio	 
	 var a7 = document.getElementsByName('q7');
     for(i = 0; i < a7.length; i++) {
          if(a7[i].checked) {
			  selectedAnswers.push(a7[i].value)
               if(a7[i].value == '14') {
               correctAnswersArray.push("Question 7: " + a7[i].value)
                    correctAnswers++;
                    break;
               }
          }
     }
//radio
	 var a8 = document.getElementsByName('q8');
     for(i = 0; i < a8.length; i++) {
          if(a8[i].checked) {
			  	selectedAnswers.push(a8[i].value)
               if(a8[i].value == '16') {
                correctAnswersArray.push("Question 8: " + a8[i].value)
                   correctAnswers++;
                    break;
               }
          }
     }
//radio	 
	 var a9 = document.getElementsByName('q9');
     for(i = 0; i < a9.length; i++) {
          if(a9[i].checked) {
			   selectedAnswers.push(a9[i].value)
               if(a9[i].value == '18') {
               correctAnswersArray.push("Question 9: " + a9[i].value)
                    correctAnswers++;
                    break;
               }
          }
     }
/*//checkbox
	 var a10 = document.getElementsByName('q10');
     var a10answers = new Array();
		var a10right = new Array('10','20');
     var a10bool = true;
 
     for(i = 0; i < a10.length; i++) {
          if(a10[i].checked) {
               	a10answers.push(a10[i].value);
}
     }
	a10answers.sort();
	var a10answersStr = a10answers.toString();
	var a10answersSplit = a10answersStr.split(",");
	var a10answersTidy = a10answersSplit.join(" and ") 
	selectedAnswers.push(a10answersTidy)
	a10right.sort();
     if(a10answers.length == a10right.length) {
          for(i = 0; i < a10answers.length; i++) {
               if(a10answers[i] != a10right[i]) {
                    a10bool = false;
                    break;
               }
          }
     }
     else {
          a10bool = false;
     }
     if(a10bool == true) {
          correctAnswers++;
     }*/
	 //radio	 
	 var a10 = document.getElementsByName('q10');
     for(i = 0; i < a10.length; i++) {
          if(a10[i].checked) {
			   selectedAnswers.push(a10[i].value)
               if(a10[i].value == '20') {
               correctAnswersArray.push("Question 10: " + a10[i].value)
                    correctAnswers++;
                    break;
               }
          }
     }
	//scoring      
		  if(correctAnswers == totalQuestions) {
          alertText = "Congratulations! You got all the questions right!";
     }
     else {
          alertText = "You got " + correctAnswers + " out of " + totalQuestions + " correct!";
     }
	
	 document.getElementById("feedback").innerHTML=alertText; 
	// document.getElementById("message").innerHTML = selectedAnswers.valueOf();
	 document.getElementById("correct").innerHTML = correctAnswersArray.valueOf();

	}

